﻿using System.Linq;
using System.Web.DomainServices;
using System.Web.DomainServices.Providers;
using System.Web.Ria;
using SoftSource.Timecard.Web.Data;

namespace SoftSource.Timecard.Web.Services
{
    [EnableClientAccess]
    [RequiresAuthentication]
    [RequiresRole("Administrator")]
    public class InvoicingService : LinqToSqlDomainService<InvoicingDBDataContext>
    {
        public IQueryable<InvoicingProject> GetInvoicingProjects()
        {
            return this.DataContext.InvoicingProjects;
        }

        public void UpdateInvoicingProject(InvoicingProject currentInvoicingProject)
        {
            this.DataContext.InvoicingProjects.Attach(currentInvoicingProject, this.ChangeSet.GetOriginal(currentInvoicingProject));
        }
    }
}


